<template>
	<section class="scholl">
		<div>
			<ul>
				<li v-for="item in lists" :key="item.id" :id="item.id">
					<router-link tag="div" :to="item.link" class="size_list layout pt30rem pb30rem pl30rem pr30rem border-b">
						<p class="flex_1 layout">
							<span class="fs30rem c333s">{{item.name}}</span>
							<i class="iconfont icon-right2 fs20rem color999"></i>
						</p>
					</router-link>	
				</li>
			</ul>
			<div class="fixed flex" style="bottom:5rem">
  				<button @click="loginOut" class="mt20rem mr30rem ml30rem mb20rem btn cxo-red align-center fs30rem white flex_1 radius">
	  				退出登录
	  			</button>
			</div>
		</div>
	</section>
</template>

<script>
	import { userLoginout } from "@/api/member";
	import $toast   from '@/utils/toast';
	import { iosapp } from "@/utils";
	export default{
	    data()
		{
		    return{
		    	lists: [
		    		{ id: 0, name: "个人信息", link: "set/MemberInfo"},
		    		{ id: 1, name: "修改密码", link: "set/ChangePw"},
		    		{ id: 2, name: "实名认证", link: "set/Verified"},
		    		{ id: 3, name: "发票管理", link: "invoice"}
		    	],
		    	uid: localStorage.getItem("uid"),
		    	isiOS : this.$route.query.isiOS
            }
		},
		methods:
		{
			loginOut()
			{
				userLoginout(this.uid).then( res => {
					if(this.isiOS)
						iosapp('ExperienceLogOut');
					else{
						this.$store.dispatch("logout");
						$toast('退出成功')
						this.$router.replace('/login');
					}
				})
			}
		}
	}
</script>
<style lang="less">
	.go-out{
		display: block;
		width: 92%;
		background-color: #ff0036;
		border-radius: 5px;
		position: absolute;
		bottom: 50/28rem;
	}
</style>
